
<!DOCTYPE html>
<html>
<head>
<meta charset="GBK" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>心教育-欢迎登录</title>
<link rel="icon" href="${root}favicon.ico" />
<link type="text/css" rel="stylesheet" href="${root}css/common.css">
<link type="text/css" rel="stylesheet" href="${root}css/login.css" />
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery-qrcode/1.0.0/jquery.qrcode.min.js"></script>
<script>
	/**
	 * 移动设备进入web化课堂跳转任务详情页
	 */
	(
			function() {
				var reg = /(iphone|ios|android|mini|mobile|mobi|Nokia|Symbian|iPod|iPad|Windows\s+Phone|MQQBrowser|wp7|wp8|UCBrowser7|UCWEB|360\s+Aphone\s+Browser)/i;
				if (reg.test(navigator.userAgent)) {
					location.href='http://m.iepsy.com/login${isEmpty(p.goto)?'':'?goto='+p.goto}'
				}
			})();
</script>
</head>
<body>
	<!-- SDK 登录 -->
	<div class="w">
		<div id="logo">
			<a href="${root}" clstag="pageclick|keycount|20150112ABD|45">
				<img src="${root}images/edulogo.png" alt="心教育"
				width="170" height="60">
			</a> <b></b>
		</div>
		<!-- <a href="" target="_blank" class="q-link"><b></b>登录页面，调查问卷</a> -->
	</div>
	<div id="content">
		<div class="login-wrap" style="margin-bottom: 0px;">
			<div class="w">
				<div class="login-form">
					<div class="login-tab login-tab-l" style="z-index: 999;">
						<a href="javascript:void(0)" class="logingh1 checked"
							clstag="pageclick|keycount|201607144|1"> 账户登录</a>
					</div>
					<div class="login-tab login-tab-r" style="z-index: 999;">
						<a href="javascript:void(0)" class="logingh1"
							clstag="pageclick|keycount|201607144|2">微信登录</a>
					</div>
					<div class="login-box" >
						<div class="mt tab-h"></div>
						<div class="msg-wrap"> 
							<div class="msg-error hide">
								<b></b>
							</div>
						</div>
						<div class="mc">
							<div class="form">
								<form id="formlogin" action="${root}users/login" method="post" >
									<div class="item item-fore1">
									<input name="goto" type="hidden" value="${p.goto}"  />
										<label for="loginname" class="login-label name-label"></label>
										<input id="username" type="text" class="itxt"
											name="username" tabindex="1" autocomplete="off"
											placeholder="邮箱/用户名/已验证手机" /> <span class="clear-btn"></span>
									</div>

									<div id="entry" class="item item-fore2">
										<label class="login-label pwd-label" for="nloginpwd"></label>
										<input type="password" id="password" name="password"
											class="itxt itxt-error" tabindex="2" autocomplete="off"
											placeholder="密码" /> <span class="clear-btn"></span> <span
											class="capslock"><b></b>大小写锁定已打开</span>
									</div>
									<div id="o-authcode" class="item item-vcode item-fore3   ">
										<input id="hidecode" type="hidden" value="${session.KERBORES_NUTZ_CAPTCHA!'&^&*'}" />
										<input id="authcode" type="text" class="itxt itxt02" 
										 tabindex="3"> <img
											id="JD_Verification1" class="verify-code"
											 />
										<a href="javascript:void(0)"
											onclick="$('#JD_Verification1').click();">看不清换一张</a>
									</div>

									<div class="item item-fore4">
										<div class="safe">
											<span> </span> <span class="forget-pw-safe"> <a
												href="${root}forget" class="">忘记密码</a>
											</span>
										</div>
									</div>

									<div class="item item-fore5">
										<div class="login-btn">
											<a href="javascript:;" class="btn-img btn-entry"
												id="loginsubmit" tabindex="6"
												clstag="pageclick|keycount|201607144|3">登&nbsp;&nbsp;&nbsp;&nbsp;录</a>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>

					<div class="qrcode-login" style="padding: 0px 18px 20px 20px;" >
						<div class="mc" style="padding-bottom:30px;">
							<div class="qrcode-error-2016">
								<div class="qrcode-error-mask"></div>
								<p class="err-cont">服务器出错</p>
								<a href="javascript:void(0)" class="refresh-btn">刷新</a>
							</div>
							<div class="qrcode-main" style="height: 298px;">
								<div  id="qrcode-img" style="box-sizing:border-box;z-index: -100;margin-top:-56px;" >
									<!-- <img src="https://open.weixin.qq.com/connect/qrcode/031eOXWPIFthalnZ" width="147" height="147"> -->
								</div>
								<div class="qrcode-help" style="display: none;"></div>
							</div>
							<div class="qrcode-panel" style="display: none;">
								<ul>
									<li class="fore1"><span>打开</span> <a
										href="#" > <span class="red">微信</span></a>
									</li>
									<li>扫描二维码</li>
								</ul>
							</div>
							<div class="coagent qr-coagent" id="qrCoagent" style="display: none;">
								<ul>
									<li><b></b><em>免输入</em></li>
									<li><b class="faster"></b><em>更快&nbsp;</em></li>
									<li><b class="more-safe"></b><em>更安全</em></li>
								</ul>
							</div>
						</div>
					</div>
					<div class="coagent" id="kbCoagent">
						<ul>
							<li><b></b> <a href="javascript:void(0)"
								onclick="window.location='https://api.weibo.com/oauth2/authorize?client_id=3548294181&response_type=code&redirect_uri=http://www.iepsy.com/login/sina';return false;"
								clstag="pageclick|keycount|201607144|6" class="pdl"><b
									class="QQ-icon" style="background: url(http://www.sinaimg.cn/blog/developer/wiki/LOGO_16x16.png) no-repeat;"></b><span>微博</span></a> <span class="line">|</span>
							</li>
							<li><a href="javascript:void(0)"
								onclick="window.location='https://open.weixin.qq.com/connect/qrconnect?appid=wxe86dd9c3d7581239&redirect_uri=http%3A%2F%2Fwww.iepsy.com%2Flogin%2Fwx&response_type=code&scope=snsapi_login#wechat_redirect';return false;"
								clstag="pageclick|keycount|201607144|7" class="pdl"><b
									class="weixin-icon"></b><span>微信</span></a></li>
							<li class="extra-r">
								<div>
									<div class="regist-link">
										<a
											href="${root}reg.html"
											clstag="pageclick|keycount|201607144|8" ><b></b>立即注册</a>
									</div>
								</div>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="login-banner" style="background-color: #ABCBEE"><div class="w"><div id="banner-bg" clstag="pageclick|keycount|20150112ABD|46" class="i-inner" style="background: url('${root}images/loginbg.png') 0px 0px no-repeat;background-color: #f795cc"></div></div></div>
		</div>
	</div>
	<!--:include("/inc/footer.html"){}  -->
	<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
<script type="text/javascript">
$(function(){
	$("#hidecode").val("${obj!}")//刷新验证码
	$(".login-tab-r").click(function(){//扫码登录
		$(".logingh1").removeClass("checked")
		$(this).find("a").addClass("checked")
		$(".login-box").attr("style","display: none;")
		$(".qrcode-login").attr("style","display: block; visibility: visible;")
	})
	$(".login-tab-l").click(function(){//用户名登陆
		$(".logingh1").removeClass("checked")
		$(this).find("a").addClass("checked")
		$(".login-box").attr("style","display: block;")
		$(".qrcode-login").attr("style","")
	})
	//$(".qrcode-img").qrcode({width: 147,height: 147,text: "${root}login/index?sid=${session.id}"});
	var obj = new WxLogin({
        id:"qrcode-img", 
        appid: "wxe86dd9c3d7581239", 
        scope: "snsapi_login", 
        redirect_uri: "http%3a%2f%2fwww.iepsy.com%2flogin%2fwx",
        state: "${date().time}",
        style: "white",
        href: ""
      });
	$("#JD_Verification1").click(function(){    
			var t=new Date().getTime();
			$("#JD_Verification1").attr("src","${root}captcha/4?time="+t)
			setTimeout(function () { 
				$.ajax({type:"get",async : true,url:"${root}login.txt?time="+t,beforeSend:function(){
	        	}, success:function(result){ $("#hidecode").val(result) }});
    		},500);
        	
    });
	$("#JD_Verification1").click()
	$("#loginsubmit").click(function(){
		if($("#username").val()==""){
			//TODO 验证码错误
			alert("用户名为空!")
		}
		else if($("#password").val()==""){
			//TODO 验证码错误
			alert("密码为空!")
		}else if($("#authcode").val()==""){
			alert("验证码为空!")
		}else if($("#authcode").val().toLowerCase()!=$("#hidecode").val().toLowerCase()){
			//TODO 验证码错误
			alert("验证码错误!")
		}else{
			$.ajax({
		        type: "GET",
		        url: "${root}json/login/validate_user",
		        data: {username:$("#username").val(),password:$("#password").val()},
		        dataType: "json",
		        success: function(data){
		        	if(data.status==0){
		        		//alert(data.msg)
		        	}else{//用户验证成功
		        		$("#formlogin").submit();
		        	}
		          }
		    });
		}
	})
})
function qrcodelogin(){
	$.ajax({
        type: "GET",
        url: "${root}raw/login/gotourl",
        data: {},
        dataType: "text",
        success: function(data){
        	if(data=="null"||data==""||data==null){
        		setTimeout('qrcodelogin()',5000);
        	}else{
        		$.get("${root}raw/login/gotourl",{remove:"yes"}, function(result){});
        		window.location.href=data;
        	}
          }
    });
}
setTimeout('qrcodelogin()',5000);
</script>
</body>
</html>


